package com.qumoyugo.springframework.context.event;

import com.qumoyugo.springframework.context.ApplicationContext;
import com.qumoyugo.springframework.context.ApplicationEvent;

/**
 * @author Cedric
 * @date 2021/11/29 10:14
 * @description 定义事件和获取上下文对象
 */
public class ApplicationContextEvent extends ApplicationEvent {
    /**
     * Constructs a prototypical Event.
     *
     * @param source the object on which the Event initially occurred
     * @throws IllegalArgumentException if source is null
     */
    public ApplicationContextEvent(Object source) {
        super(source);
    }

    public final ApplicationContext getApplicationContext() {
        return (ApplicationContext) source;
    }
}
